import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:practice_project/pages/bottom_sheet_modal.dart';
import 'package:practice_project/pages/email_sender.dart';

class HomePage extends StatefulWidget {
  const HomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
        centerTitle: true,
      ),
      body: ListView(
        children: [
          ListTile(
            title: const Text('底部弹窗-M'),
            onTap: (){
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) => const BottomSheetModal()),
              );
            },
          ),
          ListTile(
            title: const Text('邮件发送-C'),
            trailing: const Text('Error', style: TextStyle(color: Colors.red)),
            onTap: (){
              Navigator.push(
                context,
                CupertinoPageRoute(builder: (context) => const EmailSender()),
              );
            },
          )
        ],
      )
    );
  }
}